#ifndef RPG_TMP_DEME_ORZ
#define RPG_TMP_DEME_ORZ

#include "rpg_common_template.h"

template<typename T>
class RPG_Magic_Demo : public RPG_Common<T>
{
//init m_data....
public:
	RPG_Magic_Demo(T* t = NULL):RPG_Common(t){}
//.....use m_data do every thing you wanna!
public:
	void	castSkill(int skill_id){m_data->castSkill(skill_id);}
	int		getMana(){return m_data->mana;}
	char*	getName(){return m_data->name;}
};



template<typename T>
class RPG_Warrior_Demo : public RPG_Common<T>
{
	//init m_data....
public:
	RPG_Warrior_Demo(T* t = NULL):RPG_Common(t){}
	//.....use m_data do every thing you wanna!
public:
	void	useSkill(int skill_id){m_data->useSkill(skill_id);}
	int		getHP(){return m_data->hp;}
	char*	getInfo(){return m_data->getPlayerInfo();}
};


//implement demonstrate...   
#define PLAYER_DEMO_NAME	"fooo"
#define PLAYER_DEMO_HP		100
#define PLAYER_DEMO_MANA	50
#define PLAYER_DEMO_INFO	"foo and cool!"
#define PLAYER_DEMO_SKILL0	"fire ball"
#define PLAYER_DEMO_SKILL1	"water bullet"
#define PLAYER_DEMO_SKILL2	"hummer hit"
#define PLAYER_DEMO_SKILL3	"shoot"

class Player
{
public:
	Player()
	{
		name = PLAYER_DEMO_NAME;
		hp = PLAYER_DEMO_HP;
		mana =  PLAYER_DEMO_MANA;
	}

	int hp;
	int mana;
	char* name;
	void castSkill(int id){printf("%s\n",id%2 == 0 ?PLAYER_DEMO_SKILL0:PLAYER_DEMO_SKILL1);}
	void useSkill(int id){printf("%s\n",id%2 == 0 ?PLAYER_DEMO_SKILL2:PLAYER_DEMO_SKILL3);}
	char* getPlayerInfo(){return PLAYER_DEMO_INFO;}
};

//int main()
//{
//	RPG_Magic_Demo<Player> magic;
//	printf("============Magic===========\n");
//	magic.castSkill(1);
//	printf("magic[name:%s mana:%d]\n",magic.getName(),magic.getMana());
//
//	Player* player = new Player;
//	player->hp = 1000;
//	RPG_Warrior_Demo<Player> Warrior(player);
//	printf("============Warrior===========\n");
//	Warrior.useSkill(1);
//	printf("Warrior[info:%s hp:%d]\n",Warrior.getInfo(),Warrior.getHP());
//	delete player;
//
//	system("pause");
//	return 0;
//}


#endif